<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <title>{:C('SYSTEM_NAME')}</title>
    <include file="Common:head" />
    <include file="Common:formvalidator" />
</head>
<body class="skin-blue-light">
    <!-- Site wrapper -->
    <div class="wrapper">
        <header class="main-header">
            <a href="{:U()}" class="logo"><b>{:C('SYSTEM_NAME')}</b></a>
            <!-- Header Navbar: style can be found in header.less -->
            <nav class="navbar navbar-static-top" role="navigation">
                <!-- Sidebar toggle button-->
                <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <div  class="text-right" style="line-height: 50px;margin-right: 10px">
                    <span style="color:#FFF">{$userInfo.username} [{$userInfo.rolename}] |</span>
                    <a href="javascript:logout();" style="color: #FFF;" > 退出</a>
                </div>
            </nav>
        </header>
        <!-- Left side column. contains the sidebar -->
        <aside class="main-sidebar">
            <!-- sidebar: style can be found in sidebar.less -->
            <include file="Index:left" />
            <!-- /.sidebar -->
        </aside>
        <!-- =============================================== -->
        <!-- Right side column. Contains the navbar and content of the page -->
        <div class="content-wrapper" id="pageContent" >
            <!-- Content Header (Page header) -->
            <section class="content-header" >
                <h1>
                    后台首页
                    <small>欢迎使用</small>
                </h1>
                <ol class="breadcrumb">
                    <li><a href="{:U()}"><i class="fa fa-dashboard"></i> 首页</a></li>
                    <li class="active">系统总览</li>
                </ol>
            </section>
            <!-- Main content -->
             <include file="Index:home" />
        </div><!-- /.content-wrapper -->
    </div><!-- ./wrapper -->
<include file="Common:footer" />
<script type="text/javascript">
    //退出登录
    function logout() {
        $.messager.confirm('提示信息', '确定要退出登录吗？', function (result) {
            if (result)
                window.location.href = "{:U('Index/logout')}";
        });
    }
    //防止登录超时
    setInterval(function () {
        $.get("{:U('Index/public_sessionLife')}");
    }, 600000);
    $(".treeview-menu .nav").each(function () {
        var This = $(this);
        $(this).click(function () {
            $(".treeview-menu li").removeClass('active');
            This.parent().addClass('active');
            loadContent(This.attr("href"));
            return false;
        });
    });

    function loadContent(url) {
        $("#pageContent").load(url,null,function(){
            //easeUi
            $.parser.parse('#pageContent');
            $("#pageContent").attr("href", url);
        });

    }

    function reloadContent() {
        $("#pageContent").load($("#pageContent").attr("href"));
    }
</script>
</body>
</html>